import request from '@/utils/request';

// 查询商品列表
export function listProduct(query) {
  return request({
    url: '/system/product/list',
    method: 'get',
    params: query
  });
}

// 查询商品详情
export function getProduct(productId) {
  return request({
    url: '/system/product/' + productId,
    method: 'get'
  });
}

// 新增商品
export function addProduct(data) {
  return request({
    url: '/system/product',
    method: 'post',
    data: data
  });
}

// 修改商品
export function updateProduct(data) {
  return request({
    url: '/system/product',
    method: 'put',
    data: data
  });
}

// 删除商品
export function delProduct(productId) {
  return request({
    url: '/system/product/' + productId,
    method: 'delete'
  });
}

// 新增套餐
export function addPackage(data) {
  return request({
    url: '/system/product/package/add',
    method: 'post',
    data: data
  });
}

// 商品库存记录
export function listStockRecord(query) {
  return request({
    url: '/system/product/stock/record/list',
    method: 'get',
    params: query
  });
}

// 追加商品库存 post
export function addProductStock(data) {
  return request({
    url: '/system/product/stock/add',
    method: 'post',
    data: data
  });
}
